<style>
    .form-group .required:before{
        content:'* ';
        color:red;
    }
</style>
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <input type="hidden" name="row[id]" value="{$row.id ?? 0}">
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2 required">{:__('Group')}:</label>
        <div class="col-xs-12 col-sm-6">
            {$groupList}
        </div>
    </div>
    <div class="form-group">
        <label for="c-nickname" class="control-label col-xs-12 col-sm-2 required">昵称:</label>
        <div class="col-xs-12 col-sm-6">
            <input id="c-nickname" data-rule="" class="form-control" name="row[username]" type="text" value="{$row.username ?? ''}">
        </div>
    </div>






    <div class="form-group">
        <label for="c-password" class="control-label col-xs-12 col-sm-2">{:__('Password')}:</label>
        <div class="col-xs-12 col-sm-6">
            {if condition="(empty($row) neq true)" }
            <input id="c-password" data-rule="password" class="form-control" name="row[password]" type="password" value="" placeholder="{:__('Leave password blank if dont want to change')}" autocomplete="new-password" />
            {else/}
            <input id="c-password" data-rule="password" class="form-control" name="row[password]" type="text" value="" placeholder="{:__('Please enter your password')}" autocomplete="new-password" />
            {/if}


        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2 required">{:__('Gender')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[gender]', ['1'=>__('Male'), '0'=>__('Female')], $gender)}
        </div>
    </div>



    <div class="form-group">
        <label for="c-mobile" class="control-label col-xs-12 col-sm-2">{:__('Mobile')}:</label>
        <div class="col-xs-12 col-sm-6">
            <input id="c-mobile" data-rule="" class="form-control" name="row[mobile]" type="text" value="{$row.mobile ?? ''}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-avatar" class="control-label col-xs-12 col-sm-2">{:__('Avatar')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-avatar" data-rule="" class="form-control" size="50" name="row[avatar]" type="text" value="{$avatar}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-avatar" class="btn btn-danger faupload" data-input-id="c-avatar" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-avatar"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-avatar" class="btn btn-primary fachoose" data-input-id="c-avatar" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-avatar"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-avatar">

                <li class="col-xs-3">
                    <a href="{$avatar}" data-url="{$avatar}" target="_blank" class="thumbnail">
                        <img src="{$avatar}" onerror="this.src='/admin.php/ajax/icon?suffix=png';this.onerror=null;" class="img-responsive">
                    </a>
                    <a href="javascript:;" class="btn btn-danger btn-xs btn-trash"><i class="fa fa-trash"></i></a>
                </li>

            </ul>
        </div>
    </div>

    <input id="c-level" data-rule="" class="form-control" name="row[level]" type="hidden" value="{$row.level ?? 0}">

    <div class="form-group">
        <label for="c-birthday" class="control-label col-xs-12 col-sm-2">{:__('birthdays')}:</label>
        <div class="col-xs-12 col-sm-6">

            <input type='text' class="form-control datetimepicker" data-rule="required" id="birthday" name="row[birthday]"   data-date-format="YYYY-MM-DD" autocomplete="" value="{$row.birthday ?? ''}"  id="myDatetimepicker"/>

        </div>
    </div>
    {if condition="(empty($row) neq true)" }
    <div class="form-group">
        <label for="c-email" class="control-label col-xs-12 col-sm-2">{:__('Age')}:</label>
        <div class="col-xs-12 col-sm-6">
            <input id="c-email" data-rule="" class="form-control"  type="text" value="{$row.age ?? '0'}" disabled>
        </div>
    </div>


    <div class="form-group">
        <label for="c-successions" class="control-label col-xs-12 col-sm-2">{:__('Successions')}:</label>
        <div class="col-xs-12 col-sm-6">
            <input id="c-successions" data-rule="required" class="form-control" name="row[successions]" type="number" value="{$row.successions}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-maxsuccessions" class="control-label col-xs-12 col-sm-2">{:__('Maxsuccessions')}:</label>
        <div class="col-xs-12 col-sm-6">
            <input id="c-maxsuccessions" data-rule="required" class="form-control" name="row[maxsuccessions]" type="number" value="{$row.maxsuccessions}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-prevtime" class="control-label col-xs-12 col-sm-2">{:__('Prevtime')}:</label>
        <div class="col-xs-12 col-sm-6">
            <input id="c-prevtime" data-rule="" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="" type="text" value="{$row.prevtime|datetime}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-logintime" class="control-label col-xs-12 col-sm-2">{:__('Logintime')}:</label>
        <div class="col-xs-12 col-sm-6">
            <input id="c-logintime" data-rule="" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" type="text" value="{$row.logintime|datetime}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-loginip" class="control-label col-xs-12 col-sm-2">{:__('Loginip')}:</label>
        <div class="col-xs-12 col-sm-6">
            <input id="c-loginip" data-rule="" class="form-control" disabled type="text" value="{$row.loginip}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-loginfailure" class="control-label col-xs-12 col-sm-2">{:__('Loginfailure')}:</label>
        <div class="col-xs-12 col-sm-6">
            <input id="c-loginfailure" data-rule="required" class="form-control" name="row[loginfailure]" type="number" value="{$row.loginfailure}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-joinip" class="control-label col-xs-12 col-sm-2">{:__('Joinip')}:</label>
        <div class="col-xs-12 col-sm-6">
            <input id="c-joinip" data-rule="required" class="form-control" name="row[joinip]" type="text" value="{$row.joinip}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-jointime" class="control-label col-xs-12 col-sm-2">{:__('Jointime')}:</label>
        <div class="col-xs-12 col-sm-6">
            <input id="c-jointime"  class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true"  type="text" value="{$row.jointime|datetime}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[status]', ['normal'=>__('Normal'), 'hidden'=>__('Hidden')], $row['status'])}
        </div>
    </div>
    {/if}
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>

